import Mock from 'mockjs'
import { data } from './home'
import {detailData} from './detail'
import { fruitsData, vegData, seafoodData, meatData, Allcategory } from './category'
/**
 * 模拟 GET 请求 
 */
Mock.mock('http://127.0.0.1:5173/mock/api/tab/1', 'get', () => {
  // console.log('Mock_home')
  // 按照接口规范模拟数据
  return {
    code: 200,
    data
  }
})
Mock.mock('http://127.0.0.1:5173/mock/api/category', 'get', () => {
  console.log('Mock_category')
  // console.log(Allcategory)
  // 按照接口规范模拟数据
  return {
    code: 200,
    data:Allcategory
  }
})
Mock.mock('http://127.0.0.1:5173/mock/api/category/1', 'get', () => {
  console.log('Mock_fruits_category')
  // console.log(fruitsData)
  // 按照接口规范模拟数据
  return {
    code: 200,
    data:fruitsData
  }
})
Mock.mock('http://127.0.0.1:5173/mock/api/category/2', 'get', () => {
  // 按照接口规范模拟数据
  return {
    code: 200,
    data:vegData
  }
})
Mock.mock('http://127.0.0.1:5173/mock/api/category/3', 'get', () => {
  // 按照接口规范模拟数据
  return {
    code: 200,
    data:seafoodData
  }
})
Mock.mock('http://127.0.0.1:5173/mock/api/category/4', 'get', () => {
  // 按照接口规范模拟数据
  return {
    code: 200,
    data:meatData
  }
})

Mock.mock('http://127.0.0.1:5173/mock/api/detail', 'get', () => {
  // 按照接口规范模拟数据
  return {
    code: 200,
    data:detailData
  }
})